﻿CREATE TRIGGER [tr_TrackerRequest_TechnicianID]
ON dbo.t_TrackerRequest 
FOR UPDATE
AS

IF NOT UPDATE (TechnicianID) RETURN

IF dbo.RequestStatus_Attr_LockInstaller(DEFAULT,(SELECT StatusID FROM inserted)) = 0 RETURN

DECLARE @Status sysname SELECT @Status = t_Menu.MenuName FROM inserted i INNER JOIN t_Menu ON i.StatusID = t_Menu.MenuID
RAISERROR('Can''t change Installer while in [%s] status.',16,1,@Status)
ROLLBACK TRAN
